package com.terrynoya.fight.stateMachine.triggers
{
	import com.terrynoya.fight.char.Character;
	import com.terrynoya.fight.evaluation.Node;
	import com.terrynoya.fight.evaluation.ParseState;

	public class SelfAnimExist
	{
		public function SelfAnimExist()
		{
			
		}
		
		public static function eval(state:Object,node:Node):*
		{
			var chara:Character = Character(state);
			if(chara == null)
			{
				return false;
			}
			var animationId:int = node.getChildAt(0).excute(state);
			return chara.animationManager.hasAnimation(animationId);
		}
		
		public static function parse(state:ParseState):Node
		{
			return state.buildParenNumberNode(true);
		}
	}
}